import React, { Component } from 'react'

export default class List extends Component {
    render() {
        const {data, delItem} = this.props;
        return (
            <div>
            <h2>正在进行的条数: {data.length}</h2>
            <ul>
                {
                    data.map( (item,index)=>(
                        <li key={index}>
                            <input type="checkbox" />
                            {item}  ---
                            <button onClick = {()=>delItem(index)} id = {item.value}>删除</button>
                        </li>
                    ))
                }
            </ul>
            </div>
        )
    }
}
